//
//@File    :	3.1_limits.cpp
//@Time    :	2021/07/30 21:30:53
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	some integer limits
//

#include <climits>
#include <iostream>

int main()
{
    using namespace std;
    int n_int = INT_MAX;
    short n_short = SHRT_MAX;
    long n_long = LONG_MAX;
    long long n_llong = LLONG_MAX;

    cout<<"int is "<<sizeof(int)<<" bytess."<<endl;
    cout<<"short is "<<sizeof n_short<<" bytes."<<endl;
    cout<<"long is "<<sizeof n_long<<" bytes."<<endl;
    cout<<"long long is "<<sizeof n_llong<<" bytes."<<endl;
    cout<<endl;

    cout<<"Maximum values:"<<endl;
    cout<<"int: "<<n_int<<endl;
    cout<<"short: "<<n_short<<endl;
    cout<<"long: "<<n_long<<endl;
    cout<<"long long: "<<endl;

    cout<<"minimum int value = "<<INT_MIN<<endl;
    cout<<"bits per byte = "<<CHAR_BIT<<endl;
    system("pause");
    return 0;
}